<template>
  <div>
    <template v-for="item in navMenus">
      <!-- 一级 -->
      <el-menu-item
        class="ellipsis fml-el-index"
        :class="$route.path==item.url?'is-active' :''"
        :index="'/security_factor'+item.url"
        v-if="item.url&&item.leaf"
        :key="item.id"
      >
        <i class="iconfont" :class="item.icon?item.icon:'el-icon-document'" ></i>
        <span slot="title">{{item.objectName}}</span>
      </el-menu-item>
      <!-- 多级 -->
      <el-submenu
        :index="item.objectName"
        :key="item.id"
        v-if="item.child&&item.child.length>0&&!item.leaf"
      >
        <template slot="title">
          <i  class="iconfont" :class="item.icon?item.icon:'el-icon-document'" ></i>
          <span slot="title">{{item.objectName}}</span>
        </template>
        <!-- 递归 -->
        <fmlNavMenu :navMenus="item.child"></fmlNavMenu>
      </el-submenu>
    </template>
  </div>
</template>
<script lang="ts">
import Vue from 'vue'
export default Vue.extend({
  name: "fmlNavMenu",
  props: ["navMenus"],
})
</script>
